package com.blb.educourseservice.controller;

import com.blb.common.entity.CourseType;
import com.blb.common.util.ResponseResult;
import com.blb.educourseservice.service.CourseTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class CourseTypeController {

    @Autowired
    private CourseTypeService courseTypeService;

    @RequestMapping("/course-types")
    public ResponseResult<List<CourseType>> getAllCourseTypes(){
        List<CourseType> list = courseTypeService.list();
        return ResponseResult.ok(list);
    }
}
